<?php

TITRE('Gestion du SDtimes') ;


$TMP="<div align=\"center\"><a href=\"?p=sdtimes&$SID\"> SD times </a> - <a href=\"?p=sdtimes&cat=article_add&$SID\"> Entrer Article </a> - <a href=\"?p=sdtimes&cat=article_mod&$SID\"> Modifier Article </a> - <a href=\"?p=sdtimes&cat=article_view&$SID\"> Visionner Article </a> - <a href=\"?p=sdtimes&cat=times_view&$SID\"> Visionner Times </a></div>";

$query="SELECT admin_sdtimes_redacteur,admin_sdtimes_moderateur FROM sd_admin WHERE admin_user=$_USER_ID GROUP BY admin_user";
$resultat=mysql_query($query);
$tmp=mysql_fetch_array($resultat);


line_td($TMP);


IF ($tmp[0]==0){
                $TITRE_TD="ERREUR";
                $FOND_TD="Vous n'avez aucun droit administrateur.";
                base_TD($TITRE_TD,$FOND_TD);
                EXIT;
}
ELSE{
     IF ($tmp[1]==1){

             $TMP="<div align=\"center\"><a href=\"?p=sdtimes&cat=edito&$SID\"> Edito </a> - <a href=\"?p=sdtimes&cat=article_trier&$SID\"> Trier Article </a> - <a href=\"?p=sdtimes&cat=article_valid&$SID\"> Valider Article </a> - <a href=\"?p=sdtimes&cat=article_mod_admin&$SID\"> Modifier Article </a> - <a href=\"?p=sdtimes&cat=times_valid&$SID\"> Valider Times </a></div>";
             ECHO"</BR>";
             line_td($TMP);

     }


SWITCH($cat){
         CASE 'article_add':   REQUIRE("site/sdtimes/article_new.php");   BREAK;
         CASE 'article_mod':   REQUIRE("site/sdtimes/article_mod.php");   BREAK;
         CASE 'article_mod_admin':   REQUIRE("site/sdtimes/article_mod_admin.php");   BREAK;
          CASE 'article_view':   REQUIRE("site/sdtimes/article_view.php");   BREAK;
         CASE 'article_valid':   REQUIRE("site/sdtimes/article_valid.php");   BREAK;
         
         CASE 'admin':   REQUIRE("site/sdtimes/article_trier_test.php");   BREAK;

         CASE 'article_trier':   REQUIRE("site/sdtimes/article_trier.php");   BREAK;
         CASE 'edito':   REQUIRE("site/sdtimes/edito.php");   BREAK;
         CASE 'test':   REQUIRE("site/sdtimes/sdtimes_test.php");   BREAK;
         
          CASE 'times_view':   REQUIRE("site/sdtimes/times_view.php");   BREAK;
           CASE 'times_valid':   REQUIRE("site/sdtimes/times_valid.php");   BREAK;
           
          DEFAULT:
                  REQUIRE("site/sdtimes/accueil.php");
           
          BREAK;
}//fin du switch


//--------------------------------
}//Fin du else du if ($tmp[0]==0){



?>
